

#ifndef _TELETYPE_H
#define _TELETYPE_H

#include <string>
#include <atomic>

typedef int sockfd_t; 
typedef struct sockaddr_in sock_info_t;


enum class client_type : int {
	web   = 12001,
	board = 12002
};

class teletype
{	
public:	
	teletype( client_type cli_type, std::atomic<int> & terminate, sockfd_t clisock, const std::string & ip);
	teletype() = delete;	
	//teletype(const server &) = delete;
	const teletype & operator = (const teletype &) = delete;	
	~teletype();
	
	void run();

private:
	void run_web();
	void run_board();
	void shutdown();
	
public:
	client_type _cli_type;
	std::atomic<int> & _terminate;
	sockfd_t _clisock;
	std::string _cli_ip;
};
#endif  // _TELETYPE_H
